package com.nc.delivery_project.server.domain;

import java.util.Date;

public class Payment
{
    private Long id;
    private String incomingDate;
    private Currency currency;
    private Double amount;

    public Payment(){}
    public Payment(Long id)
    {
        this.id = id;
    }
    public Payment(Long id, String incomingDate, Currency currency, Double amount)
    {
        this(id);
        this.incomingDate=incomingDate;
        this.currency=currency;
        this.amount=amount;
    }

    public int getId()
    {
        return id.intValue();
    }

    public void setId(Long id)
    {
        this.id=id;
    }

    public String getIncomingDate()
    {
        return incomingDate;
    }

    public void setIncomingDate(String incomingDate)
    {
        this.incomingDate=incomingDate;
    }

    public Currency getCurrency()
    {
        return currency;
    }

    public void setCurrency(Currency currency)
    {
        this.currency=currency;
    }

    public Double getAmount()
    {
        return amount;
    }

    public void setAmount(Double amount)
    {
        this.amount=amount;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Payment)) return false;

        Payment payment = (Payment) o;

        if (incomingDate != null ? !incomingDate.equals(payment.incomingDate) : payment.incomingDate != null) return false;
        if (currency != null ? !currency.equals(payment.currency) : payment.currency != null) return false;
        if (amount != null ? !amount.equals(payment.amount) : payment.amount != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id.intValue();
        result = 31 * result + (incomingDate != null ? incomingDate.hashCode() : 0);
        result = 31 * result + (currency != null ? currency.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Payment{");
        sb.append("id=").append(id);
        sb.append(", incomingDate='").append(incomingDate).append('\'');
        sb.append(", currency='").append(currency).append('\'');
        sb.append(", amount=").append(amount);
        sb.append('}');
        return sb.toString();
    }
}
